package com.wnxy.carl.api;

import com.wnxy.carl.dto.PageDTO;
import com.wnxy.carl.dto.ShoppingDTO;
import com.wnxy.carl.param.IncreaseShopingParam;
import com.wnxy.carl.param.PageParam;
import com.wnxy.carl.response.EPage;
import com.wnxy.carl.response.Result;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "carlOrderServe",contextId = "ShoppingApi",path = "shopping")
@Api(tags = "购物车", description = "提供用户相关的 Order API")
public interface ShoppingApi {

    @PostMapping("seeShoppingCart")//查看用户购物车 PageDTO<ShoppingDTO>
    public Result<? extends EPage<ShoppingDTO>> seeShoppingCart(@RequestBody PageParam<Integer> pageParam);
    @GetMapping("amendShoppingCart")//修改购物车信息 ShoppingDTO
    public Result<ShoppingDTO> amendShoppingCart(@RequestParam("shoppingCartId") Integer shoppingCartId,@RequestParam("number") Integer number);
    @DeleteMapping("cancelShoping")//删除购物商品 Boolean
    public Result cancelShoping(@RequestParam("shoppingCartId") Integer shoppingCartId);
    @PostMapping("increaseShoping")//添加购物车商品 ShoppingDTO
    public Result<ShoppingDTO> increaseShoping(@RequestBody IncreaseShopingParam shopingParam);

}
